package com.itm.lqm.servlets.teacher;

import java.io.IOException;

import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.itm.lqm.entity.Teacher;
import com.itm.lqm.service.TeacherService;



/**
 * Servlet implementation class updateStudent
 */
@WebServlet("/updateTeacher")
public class updateTeacher extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public updateTeacher() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//获取业务逻辑层对象，修改是先查询到该对象然后修改
		//String sid=request.getParameter("sid");
		int tid=Integer.parseInt(request.getParameter("tid"));//强制转换类型
		//System.out.println(tid);
		TeacherService ts=new TeacherService();
		Teacher t= ts.findTeacherByTid(tid);
		System.out.println(t);
		request.setAttribute("t", t);
		request.getRequestDispatcher("updateTeacher.jsp").forward(request, response);	
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
